<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>K吧</title>
<link rel="stylesheet" type="text/css" href="<s:property value="staticsRoot"/>/css/front-style.css"/>
<link href="http://www.7k7kjs.cn/qike_public/qike-sns.min.css" rel="stylesheet" />
<script src="http://www.7k7kjs.cn/js/lib/jquery/1.7.2/jquery-min.js"></script>
<script src="http://www.7k7kjs.cn/qike_public/qike-sns.min.js"></script>
<script>document.domain = "7k7k.com";</script>
<script type="text/javascript" src="<s:property value="staticsRoot"/>/js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("yzm").click(function(){
		$(".mess li span").removeClass("dis_none");		
	});
	$(".mess #yzm").click(function(){
		$(".mess li span").removeClass("dis_none");
	});
});

//点击图片更换验证码
	function changeSecurityCode(){
		$("#verify").attr("src","securityCode.html?timestamp="+new Date().getTime());
	}
	function doSubmit(){
	var barNmae = $("#barName").val();
	if(barNmae==''){
	alert("吧名称不能为空！");
	return false;
	}
	var yzm = $("#yzm").val();
	if(yzm=='点击输入验证码'||yzm==''){
	alert("验证码不能为空！");
	return false;
	}
	//（同步)ajax请求
		var flag = false;
	 		$.ajax({
	    	type: "get",
	    	url: "ajaxVerifySecurityCode.html",
	    	data: {"securityCode":yzm},
			async:false,
			contentType: "application/json; charset=utf-8",
			dataType: "json",
			cache: false,			
	    	beforeSend:function(){},
	   		success: function(result)	{
						if ($.trim(result.isSuccess)=="1"){		
							flag = true;
						}else{				
							$("#securityCodeErr").html("验证码错误");
						}
					 },
	    	complete:function(){}
		});
		alert(flag);
		if(flag){
		$("#form1").submit(); 
		}else{
			return false;
		}
	}
</script>
</head>

<body>
<s:include value="include/header.jsp"/>
<div class="adress">
	<a href="###"><s:property value="#request.BarDO.name"/>k吧</a>&gt;创建新吧
</div>
<div class="mian">
	<div class="left fl">
        <p class="ts"><font><s:property value="#request.barName"/></font> 吧尚未建立！您可以先去<a href="###">k吧首页</a>逛逛<br />
        您也可以创建此吧，并与今后来到这里的朋友分享交流。
        </p>
        <ul class="mess">
        <form name="form1" id="form1" action="creatBar.html" method="post">
            <li>
            	K吧 名：<input type="text" id="barName" class="i_text"  name="barName" value ="<s:property value="#request.barName"/>"/>
   	    	</li>
   	    	 <li>验证码：<input type="text"  name="securityCode" id ="yzm" class="i_text" style="width:100px;" value="点击输入验证码" onblur="if(this.value=='') {this.value='点击输入验证码';this.style.color='#999999';}" onfocus="if(this.value=='点击输入验证码') {this.value='';}this.style.color='#000';" /><span class="dis_none"><img src="securityCode.html" id="verify"/>看不清？<a href="###" onclick="changeSecurityCode();">换一张</a></span></li>
            <li><input type="botton" onclick="doSubmit();" class="sub_btn" /></li>
            </form>
        </ul>
    </div>
    <div class="clearB"></div>
</div>
<s:include value="include/foot.jsp"/>
</body>
</html>

